package com.example.javatwo.mapper.xs.zqy;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mybatis.spring.annotation.MapperScan;

import com.example.javatwo.pojo.xs.zqy.PageBean;
import com.example.javatwo.pojo.xs.zqy.paymentdetailed1;
import com.example.javatwo.pojo.xs.zqy.paymentmain;
import com.example.javatwo.util.PageBead;



@MapperScan
public interface YsMapper {
	@Select("select count(1) from paymentmain")
	int findzong();
	
	@Select("select * from paymentmain order by fundbillno  desc LIMIT #{currentPage},1")
	List<paymentmain> findYszhu(@Param("currentPage")int currentPage);
	
	@Select("select * from paymentdetailed1 where fundbillno=#{fundbillno}")
	List<paymentdetailed1>  findYsXiang(@Param("fundbillno") String fundbillno);
	
	@Insert("insert into temp.paymentmain (Fundbillno, fundbilldate, Currid, exchrate, Cashtype, VoucherNo, customerid, cashstyleid, visastyleid, otherpaystyleid, discountper, accmonthtomonth, Deptfrom, ProjectFrom, makersign, permittType, Permittersign, Selfdefine1, Selfdefine2, memo)values(#{Fundbillno},#{fundbilldate},#{Currid},#{exchrate},#{Cashtype},#{VoucherNo},#{customerid},#{cashstyleid},#{visastyleid},#{otherpaystyleid},#{discountper},#{accmonthtomonth},#{Deptfrom},#{ProjectFrom},#{makersign},#{permittType},#{Permittersign},#{Selfdefine1},#{Selfdefine2},#{memo})")
	void insertzhu(paymentmain paymentmain);
	
	@Insert("insert into temp.paymentdetailed1(Originflag,originbilldate,originbillno,custid,custname,deptid,departname,personname, currid, exchrate, total, nowleft, discount, offset, offsetmoney, fundbillno)values(#{Originflag},#{originbilldate},#{originbillno},#{custid},#{custname},#{deptid},#{departname},#{personname},#{currid},#{exchrate},#{total},#{nowleft},#{discount},#{offset},#{offsetmoney},#{fundbillno})")
	void insertxiang(paymentdetailed1 paymentdetailed1);
	
	@Delete("delete from temp.paymentmain where Fundbillno = #{fundbillno}")
	void delzhu(@Param("fundbillno") String fundbillno);
	
	@Delete("delete from temp.paymentdetailed1 where fundbillno = #{fundbillno}")
	void delxiang(@Param("fundbillno") String fundbillno);
}
